Update xend to support vnc configuration for qemu 0.8.1 based ioemu.
authorchris@kneesaa.uk.xensource.com <chris@kneesaa.uk.xensource.com>
Wed, 12 Jul 2006 18:16:14 +0000 (19:16 +0100)
committerchris@kneesaa.uk.xensource.com <chris@kneesaa.uk.xensource.com>
Wed, 12 Jul 2006 18:16:14 +0000 (19:16 +0100)
Also add vncdisplay= option which allows setting the display number
instead of using the default display number (= domid).

Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
tools/examples/xmexample.hvm
tools/python/xen/xend/image.py
tools/python/xen/xm/create.py

index 0181a2793c9e60cd8151bc99a853f56f04dde1ba..7ec80b9bad9476c93fd4e5026f5b399124d450af 100644 (file)
@@ -129,6 +129,10 @@ sdl=0
 # enable VNC library for graphics, default = 1
 vnc=1
 
+#----------------------------------------------------------------------------
+# set VNC display number, default = domid
+#vncdisplay=1
+
 #----------------------------------------------------------------------------
 # enable spawning vncviewer(only valid when vnc=1), default = 1
 vncviewer=1
index 11d1b81ba7547111c4946e412948a1faa33b2dac..10c3c37a383cd22c282d89da06788205ee2fa6b3 100644 (file)
@@ -318,20 +318,16 @@ class HVMImageHandler(ImageHandler):
     def configVNC(self, config):
         # Handle graphics library related options
         vnc = sxp.child_value(config, 'vnc')
+        vncdisplay = sxp.child_value(config, 'vncdisplay',
+                                     int(self.vm.getDomid()))
         sdl = sxp.child_value(config, 'sdl')
         ret = []
         nographic = sxp.child_value(config, 'nographic')
         if nographic:
             ret.append('-nographic')
             return ret
-
-        if vnc and sdl:
-            ret = ret + ['-vnc-and-sdl', '-k', 'en-us']
-        elif vnc:
-            ret = ret + ['-vnc', '-k', 'en-us']
         if vnc:
-            vncport = int(self.vm.getDomid()) + 5900
-            ret = ret + ['-vncport', '%d' % vncport]
+            ret = ret + ['-vnc', '%d' % vncdisplay, '-k', 'en-us']
         return ret
 
     def createDeviceModel(self):
index 865b55f595ebd6fe5e69e6822d654706e52440c9..e5d02734651406df3386f4ff8fe2e93d019c74da 100644 (file)
@@ -406,6 +406,10 @@ gopts.var('vnc', val='',
           fn=set_value, default=None,
           use="""Should the device model use VNC?""")
 
+gopts.var('vncdisplay', val='',
+          fn=set_value, default=None,
+          use="""VNC display to use""")
+
 gopts.var('sdl', val='',
           fn=set_value, default=None,
           use="""Should the device model use SDL?""")
@@ -615,8 +619,8 @@ def configure_hvm(config_image, vals):
     """
     args = [ 'device_model', 'pae', 'vcpus', 'cdrom', 'boot', 'fda', 'fdb',
              'localtime', 'serial', 'stdvga', 'isa', 'nographic', 'audio',
-             'vnc', 'vncviewer', 'sdl', 'display', 'acpi', 'apic',
-             'xauthority', 'usb', 'usbdevice' ]
+             'vnc', 'vncdisplay', 'vncviewer', 'sdl', 'display',
+             'acpi', 'apic', 'xauthority', 'usb', 'usbdevice' ]
     for a in args:
         if (vals.__dict__[a]):
             config_image.append([a, vals.__dict__[a]])